<?php

class SLIDES extends MAIN{
	function __construct($id = 0, $column=false) {
            parent::__construct('slides', 'slideid', $id, $column);
         
		}
		
	function deactivateAllPreviousPost($slideLocation)
	{
	    $query  = "UPDATE slides SET status=0 WHERE slidelocation=:slideLocation"; 
		$prepared = $this->_conn->prepare($query);
		$prepared->execute(array('slideLocation'=>$slideLocation));
		return $prepared;
	}
	
	function getActivePost($slideLocation, $column="*")
	{
		$query  = "SELECT $column FROM slides WHERE slidelocation=:slideLocation AND status=1"; 
		$prepared = $this->_conn->prepare($query);
		$prepared->execute(array('slideLocation'=>$slideLocation));
		return $prepared;
	}
	
}
?>